﻿using System;
using System.Globalization;
using System.IO;
using System.Windows.Data;
using System.Windows;

namespace Com.CodePlex.SPC3.SPbAM.View {

	public class ServerWorkspaceDisplayNameConverter : IMultiValueConverter {

		private static ServerWorkspaceDisplayNameConverter _default = new ServerWorkspaceDisplayNameConverter();
		public static ServerWorkspaceDisplayNameConverter Default { get { return _default; } }

		public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) {
			if (values == null | values.Length != 2 | !(values[0] is string) || !(values[1] is bool)) {
				return DependencyProperty.UnsetValue;
			}
			string name = (string)values[0];
			bool modified = (bool)values[1];
			return name + (modified ? " *" : "");
		}

		public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) {
			throw new NotImplementedException();
		}
	}
}
